package andy.demo.json;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import andy.demo.R;

public class MainActivity extends Activity implements OnClickListener {
	private Button bt_single_json;
	private Button bt_muti_json;
	private Button bt_single_to_javabean;
	private Button bt_muti_to_javabean;
	private TextView text;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.json_main);
		
		bt_single_json = (Button) this.findViewById(R.id.bt_single_json);
		bt_muti_json = (Button) this.findViewById(R.id.bt_muti_json);
		bt_single_to_javabean = (Button) this.findViewById(R.id.bt_single_to_javabean);
		bt_muti_to_javabean = (Button) this.findViewById(R.id.bt_muti_to_javabean);
		text = (TextView) this.findViewById(R.id.text);
		
		bt_single_json.setOnClickListener(this);
		bt_muti_json.setOnClickListener(this);
		bt_single_to_javabean.setOnClickListener(this);
		bt_muti_to_javabean.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch(v.getId()){
		case R.id.bt_single_json:
			JsonUtils.parseMutiJson(JsonUtils.muti_jsonData);
			break;
		case R.id.bt_muti_json:
			JsonUtils.parseMutiJson(JsonUtils.muti_jsonData);
			break;
//		case R.id.bt_single_to_javabean:
//			JsonUtils.parseSingleJsonToObject(JsonUtils.single_jsonData);
//			break;
//		case R.id.bt_muti_to_javabean:
//			JsonUtils.parseMutiJsonToObject(JsonUtils.muti_jsonData);
//			break;
			
		}
		
	}
}
